/*
 * Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
 *
 * https://www.mall4j.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */
package com.yami.shop.dao;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yami.shop.bean.model.Supplier;
import com.yami.shop.bean.vo.SupplierVO;
import com.yami.shop.common.util.PageParam;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 *
 * @author SJL
 * @date 2020-08-25 15:50:06
 */
public interface SupplierMapper extends BaseMapper<Supplier> {

    /**
     * 供应商分页
     * @param page
     * @param supplier
     * @return
     */
    IPage<Supplier> pageShop(@Param("page")PageParam<Supplier> page,@Param("supplier") Supplier supplier);

    /**
     * 供应商商品分页
     * @param page
     * @param supplier
     * @return
     */
    IPage<SupplierVO> pageProdSupplier(@Param("page")PageParam<Supplier> page,@Param("supplier") Supplier supplier);

    /**
     * 获取店铺供应商列表
     * @param shopId 店铺id
     * @return 供应商列表
     */
    List<Supplier> getByShopId(@Param("shopId") Long shopId);

    /**
     * 匹配的供应商
     * @param supplier
     * @return
     */
    List<Supplier> getByParam(@Param("supplier") Supplier supplier);

    /**
     * 查找供应商名称
     * @param shopId
     * @return
     */
    List<String> listSupplierName(@Param("shopId")Long shopId);

    /**
     * 根据供应商名称获取数量
     * @param supplierName
     * @param supplierId
     * @param shopId
     * @return
     */
    Integer getCountByName(@Param("supplierName")String supplierName,@Param("supplierId")Long supplierId,@Param("shopId")Long shopId);

    /**
     * 更新供应商
     * @param supplierId
     * @return
     */
    void updateSupplierCategory(@Param("supplierId") Long supplierId);

    /**
     * 清除供应商分类信息
     * @param supplierCategoryId
     */
    void updateSupplierByCategoryId(Long supplierCategoryId);
}
